using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using WorldMapNew;
#if UNITY_EDITOR

public class PointAdornModel : MonoBehaviour
{
    private GameObject tagertObj;

    public void BindPoint(GameObject obj)
    {
        tagertObj = obj;
        transform.position = obj.transform.position;
        PointAdorn[] adorns = gameObject.GetComponentsInChildren<PointAdorn>(true);
        for (int i = 0; i < adorns.Length; i++)
        {
            adorns[i].BindPoint(obj);
        }
    }

    public GameObject GetTagertObj()
    {
        return tagertObj;
    }

    public GameObject GetTagertObj2()
    {
        GameObject obj = null;
        PointAdorn[] adorns = gameObject.GetComponentsInChildren<PointAdorn>(true);
        for (int i = 0; i < adorns.Length; i++)
        {
            if (adorns[i].Enable && adorns[i].pointObjs != null && adorns[i].pointObjs[0] != null)
            {
                return adorns[i].pointObjs[0];
            }
        }
        return obj;
    }
}
#endif